#include "..\..\include\audio\sound.h" // matching header


// ==================================
//    CONSTRUCTORS and DESTRUCTORS
// ==================================

Sound::Sound()
{
	data_ = 0;
}

Sound::Sound(const char* buffer, unsigned int size)
{
	data_ = 0;
	load(buffer, size);
}

Sound::~Sound()
{
	if (data_ != 0)
		clear();
}


// ==================================
//          LOAD and CLEAR
// ==================================

void Sound::load(const char* buffer, unsigned int size)
{
	if (data_ == 0) {
		data_ = (void*)buffer;
		size_ = size;
	}
}

void Sound::clear()
{
	delete (char*)data_;
	data_ = 0;
	size_ = 0;
}


// ==================================
//             GETTERS
// ==================================

void* Sound::getData()
{
    return data_;
}

unsigned int Sound::getSize()
{
	return size_;
}
